<template>
  <el-table :data="dept.emsList" border  align="center">
    <el-table-column prop="id" label="工号" ></el-table-column>
    <el-table-column prop="name" label="姓名"></el-table-column>
    <el-table-column prop="salary" label="工资"></el-table-column>
    <el-table-column prop="path" label="头像"></el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button type="danger" @click="deleteEms(scope.row)">删除</el-button>
        <el-button type="primary" @click="updateEms(scope.row)">修改</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
    export default {
      name: "ShowEms",
      data(){
        return{
          deptId:this.$route.query.deptId,
          dept:{}
        }
      },
      methods:{
        deleteEms(ems){

        },
        updateEms(ems){

        },
        showEms(){
          this.axios({
            method:"get",
            url:"/dept/"+this.deptId
          }).then((res)=>{
            this.dept=res.data
          })
        }
      },
      created(){
        this.showEms()
      },
      watch:{
        $route(to,from){
          this.deptId = to.query.deptId;
          this.showEms();
        }
      }
    }
</script>

<style scoped>

</style>
